package com.atguigu03.list.exer1;

import java.nio.file.FileAlreadyExistsException;

/**
 * ClassName: Ptudent
 * Package: com.atguigu03.list.exer1
 * Description:
 *
 * @Author BuTang
 * @Create 2023/6/5 16:37
 * @Version 1.0
 */
public class Student {
    String name;
    int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public String getName() {
        return name;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof Student) {
            Student s = (Student) obj;
            if (s.getAge() == this.getAge() && s.getName() == this.getName())
            return true;
            else return false;
        }
        else return false;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
